import request from '@/utils/request'

const reqPublish ={

  //上传文章封面
   uploadCover(userid,file){
     return request.post(`/upload/cover/${userid}`,file,{
        headers:{
            "Content-Type":'multipart/form-data'
        }
     }).then(res=>{
        return res.data;
     })
   },
   //发布文章
   publish(userid,file){
     return request.post(`/publish/${userid}`,file,{
        headers:{
            "Content-Type":'multipart/form-data'
        }
     }).then(res=>{
        return res.data;
     })
   },
   //上传内容图片
   uploadImg(file){
      return request.post('/upload/contentimg',file,{
         headers:{
            "Content-Type":'multipart/form-data'
        }
      }).then(res=>{
         return res.data;
      })
   },
   //删除用户取消的图片
   removeImg(imgname){
      return request.delete(`/publish/delete/${imgname}`).then(res=>{
         return res.data;
      })
   }

}
export default reqPublish;